import multiprocessing
import time

def worker_1(interval):
    for i in range(50):
        print ("worker_1 --%s" %i)
        time.sleep(1)
        print ("end worker_1")

def worker_2(interval):
    for i in range(100):
        print ("worker_2 --%s" %i)
        time.sleep(1)
        print ("end worker_2")

def worker_3(interval):
    for i in range(100):
        print ("worker_3 --%s" %i)
        time.sleep(1)
        print ("end worker_3")

if __name__ == "__main__":
    p1 = multiprocessing.Process(target = worker_1, args = (1,))
    p2 = multiprocessing.Process(target = worker_2, args = (2,))
    p3 = multiprocessing.Process(target = worker_3, args = (3,))

    p1.start()
    p2.start()
    p3.start()

    print("The number of CPU is:" + str(multiprocessing.cpu_count()))
    for p in multiprocessing.active_children():
        print("child   p.name:" + p.name + "\tp.id" + str(p.pid))
    print ("END!!!!!!!!!!!!!!!!!")